<template>
	<view>
		<tt-bar leftIcon="icon-back" title="设置"></tt-bar>
		<view class="setList">
			<view class="row tapBg" @tap="checkUpData">
				<text class="setLabel">检查更新</text>
				<!-- <text class="listRight">有新版本</text> -->
				<text class="iconfont icon-right"></text>
			</view>
			<view class="row tapBg" @tap="toPage" data-url="aboutUs">
				<text class="setLabel">关于我们</text>
				<text class="iconfont icon-right"></text>
			</view>
		</view>
		<view class="btnBox">
			<button class="tapOpt" @tap="logOut">退出登录</button>
		</view>
		<updateModal ref="upModal"></updateModal>
		<downLoding></downLoding>
	</view>
</template>

<script>
	import COMM from "@/common/common.js";
	import ttBar from "@/components/ttBar/ttBar.vue";
	import downLoding from "@/components/downLoding/downLoding.vue";
	import updateModal from "@/components/updateModal/updateModal.vue";
	import {
		mapState,
		mapGetters,
		mapMutation,
		mapActions
	} from "vuex";
	export default {
		computed:{
			...mapState({
				isLogin:state=>state.user.isLogin,
				
			})
		},
		components: {
			ttBar,
			downLoding,
			updateModal
		},
		data() {
			return {
				prs:0,
				isShow:false
			};
		},
		methods:{
			checkUpData(){
				this.$store.dispatch("apiGetUpdateInfo").then(res=>{
					this.$store.dispatch("checkUpDate").then(res=>{
						uni.showToast({
							title: '当前已是最新版本',
							icon: 'none'
						});
					});
				})
			},
			logOut(){
				this.$store.dispatch("logout");
				this.$store.commit("select",{});			//清空已选择店铺
				this.$store.commit("updateList",[]);		//清空店铺列表
				this.$store.commit("setManageData",{});		//清空经营数据
				this.$store.commit("updataCount",[])		//情况订单统计
				this.$store.dispatch("timLogOut").then(res=>{
					getApp().globalData.TIM_SDK_READY==false;
				})
				
			}
		},
		onLoad() {
			
		},
		onPullDownRefresh() {
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 1500)
		}
	}
</script>

<style lang="less">
	page {
		background-color: #f6f6f6;
	}

	.setList {
		margin-top: 26upx;
		padding: 0 18upx;
		display: flex;
		flex-direction: column;

		.row {
			display: flex;
			align-items: center;
			background-color: #FFFFFF;
			padding: 50upx 40upx 50upx 50upx;
			border-radius: 16upx;
			box-shadow: 0rpx 3rpx 17rpx 0rpx rgba(201, 202, 208, 0.15);
			margin-bottom: 10upx;

			.setLabel {
				font-size: 32rpx;
				font-weight: bold;
				color: #908bad;
				flex: 1;
			}

			.iconfont {
				color: #908bad;
			}

			.listRight {
				font-size: 28rpx;
				color: #ff7d27;
			}
		}
	}

	.btnBox {
		position: absolute;
		bottom: 50upx;
		width: 100%;
		left: 0;
		padding: 0 98upx;

		button {
			height: 88rpx;
			background-color: #ffb423;
			border-radius: 44rpx;
			border-radius: 44upx;
			border: none;
			line-height: 88upx;
			color: #FFFFFF;
			font-size: 32upx;
		}

		button:after {
			border: none;
		}
	}
</style>
